package com.peng.pay_thrift.service;

import java.util.Random;

import org.apache.thrift.TException;

import com.peng.pay_thrift.meta.PayService;
import com.peng.pay_thrift.meta.Record;
import com.peng.pay_thrift.meta.State;

/**
 * 模拟
 * 
 * @author kungfupeng
 *
 */
public class PayServer implements PayService.Iface {

	@Override
	public String getOpenId(String code) throws TException {
		// 与后台实现一样【详见后台工程，这里不做赘述】
		return "" + new Random().nextInt(65535) + "asfggnbv" + "12345" + "fbdabsd"
				+ (1234765 + new Random().nextInt(65535));
	}

	@Override
	public String getPayResult() throws TException {
		// 与后台实现一样【详见后台工程，这里不做赘述】
		return "" + new Random().nextInt(65535) + "asfggnbv" + "12345" + "fbdabsd"
				+ (1234765 + new Random().nextInt(65535));
	}

	@Override
	public String getSign(String repay_id) throws TException {
		// 与后台实现一样【详见后台工程，这里不做赘述】
		return "" + new Random().nextInt(65535) + "asfggnbv" + "12345" + "fbdabsd"
				+ (1234765 + new Random().nextInt(65535));
	}

	@Override
	public String getXD(String openid) throws TException {
		// 与后台实现一样【详见后台工程，这里不做赘述】
		return "" + new Random().nextInt(65535) + "asfggnbv" + "12345" + "fbdabsd"
				+ (1234765 + new Random().nextInt(65535));
	}

	@Override
	public State saveRecord(Record record) throws TException {
		// 与后台实现一样【详见后台工程，这里不做赘述】
		return new State(new Random().nextBoolean());
	}

}
